//
//  OpenBtn.m
//  CarTown
//
//  Created by xionghao on 15/8/27.
//  Copyright (c) 2015年 熊浩. All rights reserved.
//

#import "OpenBtn.h"

@implementation OpenBtn

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(void)awakeFromNib{
    self.titleLabel.textAlignment=NSTextAlignmentCenter;
}

-(CGRect)titleRectForContentRect:(CGRect)contentRect{
    CGFloat width=contentRect.size.width-14;
    CGFloat height=contentRect.size.height;
    CGFloat x=0;
    CGFloat y=0;
   return  CGRectMake(x, y, width, height);
}



-(CGRect)imageRectForContentRect:(CGRect)contentRect{
    CGFloat imgwidth=12;
    CGFloat height=5;
    CGFloat x=contentRect.size.width-imgwidth-2;
    CGFloat y=(contentRect.size.height-height)*0.5;
    return CGRectMake(x, y, imgwidth, height);
}
@end
